<?php
define('LMO', true);
define('BS', '/');
define('ROOT', dirname(__FILE__));
define('APP', ROOT.BS.'app');
define('LIB', APP.BS.'library');
define('CONFIG', APP.BS.'config');
include (CONFIG.BS.'/init.php');

$c = isset($_GET['c'])?$_GET['c']:'index';
$m = isset($_GET['m'])?$_GET['m']:'index';

$fc = APP.BS.'controller';
$cName = 'LC'.ucfirst($c);
if($c != null && file_exists($fc.BS.ucfirst($c).'.php')) {
    require_once ($fc.BS.ucfirst($c).'.php');
    if(!class_exists($cName)) {
        exit('Controller doesn\'t match !');
    }
    $cName = $cName::getInstance();
    $mName = $m.'Action';
    if(method_exists($cName, $mName)) {
       $cName->$mName(); 
    } else {
        exit('Method doesn\'t exist !');
    }
} else {
    exit('Controller doesn\'t exist !');
}
?>